<template>
  <div class="d-row">
    <div class="d-form-group d-form-group-flex">
      <div class="d-form-label d-text-right">
        <label class="label-text">流程单元</label>
      </div>
      <div class="d-form-el">
        <FormSelecter v-model="unitId" :data="unitList" :valueKey="'id'" :textKey="'name'" />
      </div>
    </div>
  </div>
</template>

<script>
import { FormSelecter } from '@daelui/vdog/dist/components.js'
import unitSer from '../../../service/action/exeunit.action'
import { state } from '../../../service/stock/index.js'

export default {
  components: {
    FormSelecter
  },

  data () {
    return {
      // 单元id
      unitId: '',
      // 表单数据
      state: {},
      // 单元列表
      unitList: []
    }
  },

  methods: {

  },

  beforeMount () {
    // 查询单元列表
    unitSer.queryListPage({size: 1000}).then(res => {
      this.unitList = res.data.list
      this.unitList.unshift(state.customUnit)
    })
  }
}
</script>

<style lang="less" scoped>
.d-form-label {
  width: 90px;
}
</style>
